<template>
	<view>
		<uni-nav-bar color="#fff" :fixed="true" leftWidth="50%" shadow background-color="#07C160" status-bar left-icon="left" :left-text="title">
			<block slot="left">
				<view v-if="backicon" @click="back">
					<uni-icons type="back" size="18" color="#fff" class="icon"></uni-icons>
					<view class="text">{{ title }}</view>
				</view>
				<view v-else>
					<view class="text">{{ title }}</view>
				</view>
			</block>
		</uni-nav-bar>
	</view>
</template>

<script>
export default {
	name: 'uni-titles',
	props: {
		title: {
			type: String,
			default: '返回'
		},backicon: {
			type: Boolean,
			default: true
		}
	},
	data() {
		return {};
	},
	methods: {
		back() {
			uni.navigateBack({
				delta: 1
			});
		}
	}
};
</script>

<style lang="scss">
.icon {
	display: inline-block;
	vertical-align: middle;
}
.text {
	height: 40rpx;
	line-height: 40rpx;
	display: inline-block;
	font-size: 30rpx;
	vertical-align: middle;
}
</style>
